package leetcode.weekly.week310;

//Solution2Test
public class Solution2 {

	public int partitionString(String s) {
		char[] cs = s.toCharArray();
		int ans = 0;
		int r = 0;
		boolean[] hash = new boolean[128];
		while (r < s.length()) {
			while (r < s.length() && !hash[cs[r]]) {
				hash[cs[r]] = true;
				r++;
			}
			ans += 1;
			hash = new boolean[128];
		}
		return ans;
	}
}
